import { ApiProperty } from "@nestjs/swagger";
import { Column, CreateDateColumn, Entity, UpdateDateColumn } from "typeorm";

export class CreateArticleTodo {
  @Column()
  @ApiProperty({ description: "用户Id" })
  user: string;

  // 博文标题
  @Column()
  @ApiProperty({ description: "博文标题" })
  title: string;

  // 博文内容
  @Column()
  @ApiProperty({ description: "博文内容" })
  content: string;
}

export class UpdateArticleTodo extends CreateArticleTodo {
  @Column()
  @ApiProperty()
  id: string;
}

export class ArticleTodo extends UpdateArticleTodo {
  @Column()
  @ApiProperty()
  createTime: Date;

  @Column()
  @ApiProperty()
  updateTime: Date;

  @Column()
  @ApiProperty()
  isDelete: Boolean;

  // 点赞数
  @Column()
  @ApiProperty()
  likeCount: number;

  // 评论数
  @Column()
  @ApiProperty()
  commentCount: number;

  // 游览量
  @Column()
  @ApiProperty()
  visitCount: number;
}
